package com.xiaoxx.rabbitmq.db.entity;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.xiaoxx.rabbitmq.bean.MyMessage;
import com.xiaoxx.rabbitmq.db.typehandler.MessageJsonTypeHandler;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.time.LocalDateTime;

@ApiModel(description = "mq消息表")
@Data
@TableName(value = "t_broker_message", autoResultMap = true)
public class BrokerMessage {

    @ApiModelProperty("消息ID")
    private String messageId;

    @ApiModelProperty("消息体")
    @TableField(value = "my_message", typeHandler = MessageJsonTypeHandler.class)
    private MyMessage myMessage;

    @ApiModelProperty("重试次数(默认null)")
    private Integer tryCount;

    @ApiModelProperty("下次重试时间")
    private LocalDateTime nextRetry;

    @ApiModelProperty("状态 0:发送中; 1:发送成功; 2:发送失败; 3:发送失败重试中")
    private String status;

    @ApiModelProperty("消费次数(默认null)")
    private Integer copCount;

    @ApiModelProperty("创建时间")
    private LocalDateTime createTime;

    @ApiModelProperty("更新时间")
    private LocalDateTime updateTime;

}